Typesetting {\tenbxsl APL\/} Functions

The following APL function is printed in del-editor style:


\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLM\APLE\APLA\A...
...\APLX
\end{APLfnsline}\begin{APLfnsline}{}{\APLdel}
\end{APLfnsline}\end{APLfns}

A larger font has been selected by inserting the generated code into a \Large environment:

\begin{Large}
% FNS MEAN
\begin{APLfns}
\begin{APLfnsline}{}{\APLdel}
\APLZ\APLleftarrow\APLM\APLE\APLA\APLN
\APLspace\APLX
\end{APLfnsline}
\begin{APLfnsline}{\APLleftbracket\APLone
\APLrightbracket}{}
  ...
\end{APLfns}
\end{Large}

The canonical representation of an APL function is simply a text matrix. Since older APL systems only provide arrays of uniform datatype and rectangular shape, padding of short lines with spaces is performed. In contrast to the del-editor style, the canonical representation is typeset like an APL array with fixed spacing and without line numbering. For the canonical representation of a small typewriter type style was chosen:


\begin{APLcr}
\leavevmode\hbox to 1.2em{\hss\APLZ\hss}\leavevmode\hbox to 1.2em{...
...ss\APLrho\hss}\leavevmode\hbox to 1.2em{\hss\APLX\hss}
\APLspace\par
\end{APLcr}

You notice immediately that we have used the LATEX commands \small and \tt to produce this effect:

{\small\tt
% CR MEAN
\begin{APLcr}
\APLmb{\APLZ}\APLmb{\APLleftarrow}
\APLmb{\APLM}\APLmb{\APLE}
\APLmb{\APLA}\APLmb{\APLN}
\APLmb{\APLspace}\APLmb{\APLX}
\APLspace\par
  ...
\end{APLcr}
}

In addition to the del-editor representation and the canonical representation of an APL function we provide means for formatting direct definitions of functions, which are supported by only a few APL dialects, e.g. I–APL:


\begin{APLline}
\APLf\APLi\APLb\APLcolon\APLspace\APLz\APLcomma\APLplus\APLslash...
...Lspace
\APLomega\APLequal\APLone\APLspace\APLcolon\APLspace\APLone
\end{APLline}

This direct definition of a function computing Fibonacci numbers is due to [Iverson 87] and has been formatted as follows:

\begin{APLline}
\APLf\APLi\APLb\APLcolon\APLspace\APLz
\APLcomma\APLplus\APLslash
\APLoverbar\APLtwo\APLuparrow\APLz
  ...
\end{APLline}

Note, that the APLline environment allows ligatures within names.